.slider {
  position: relative;
  width: 100%;
  padding: 12px 0;
  cursor: pointer;

  &.disabled {
    cursor: not-allowed;
    opacity: 0.6;
  }

  &.glow {
    .trackFilled {
      box-shadow: 0 0 10px var(--theme-primary-shadow);
    }

    .thumb {
      box-shadow: 0 0 15px var(--theme-primary-shadow), 0 4px 8px var(--theme-primary-shadow);
    }
  }
}

.track {
  position: relative;
  height: 8px;
  border-radius: 4px;
}

.trackClickable {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.trackBg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--theme-primary-light) 0%, var(--theme-primary-light, #FFF0F5) 50%, var(--theme-primary-light) 100%);
  border-radius: inherit;
  box-shadow: inset 0 2px 4px var(--theme-primary-shadow);
}

.trackFilled {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--theme-primary-gradient);
  border-radius: inherit;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px var(--theme-primary-shadow);

  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: inherit;
  }
}

.thumb {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  background: var(--theme-primary-gradient);
  border: 3px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px var(--theme-primary-shadow), 0 1px 0 rgba(255, 255, 255, 0.3);

  &:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 4px 12px var(--theme-primary-shadow), 0 2px 0 rgba(255, 255, 255, 0.4);
  }

  &:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.1);
  }

  &::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
  }
}

.tooltip {
  position: absolute;
  top: -40px;
  transform: translateX(-50%);
  background: var(--theme-primary-gradient);
  color: #fff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 4px 12px var(--theme-primary-shadow);
  border: 1px solid rgba(255, 255, 255, 0.2);

  &::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--theme-primary-main);
  }

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: inherit;
  }
}

/* 禁用状态样式 */
.disabled {
  .trackBg {
    background: linear-gradient(90deg, #f0f0f0 0%, #e8e8e8 50%, #f0f0f0 100%);
  }

  .trackFilled {
    background: linear-gradient(90deg, #d0d0d0 0%, #c0c0c0 50%, #d0d0d0 100%);
    box-shadow: none;
  }

  .thumb {
    background: linear-gradient(135deg, #d0d0d0 0%, #c0c0c0 100%);
    cursor: not-allowed;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);

    &:hover {
      transform: translate(-50%, -50%);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
  }
}

/* 主题特定颜色变量 */
.theme-pink {
  --theme-primary-light: #FFE4E1;
  --theme-primary-light-alt: #FFF0F5;
}

.theme-blue {
  --theme-primary-light: #E0F2FE;
  --theme-primary-light-alt: #F0F8FF;
}

.theme-purple {
  --theme-primary-light: #F3E5FF;
  --theme-primary-light-alt: #F8F4FF;
}

/* 动画效果 */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--theme-primary-shadow); }
  70% { box-shadow: 0 0 0 10px var(--theme-primary-shadow); }
  100% { box-shadow: 0 0 0 0 var(--theme-primary-shadow); }
}

.thumb:focus {
  outline: none;
  animation: pulse 1.5s infinite;
}